<template>
	<view>
		<view class="box">
			<image :src="isTrue?'/static/images/ic_tongguo.png': '/static/images/ic_jujue.png'"></image>
			<text class="box_font">{{ isTrue ? '核验通过' : '核验拒绝' }}</text>
			<text v-if="!isTrue" class="box_fontb">客户购买的凭证已失效，不能进场</text>
			<view v-if="isTrue && info" class="box_ctn">
				<view class="xm">{{ info.orderType }}</view>
				<view>{{ info.venueName }} | {{ info.name || info.projectName }}</view>
				<view v-if="info.name && info.projectName">{{ info.projectName }}</view>
				<view v-if="info.areaName && info.siteName">{{ info.areaName }} | {{ info.siteName }}</view>
				<view>{{ info.date }}{{ info.timeInterval || '' }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			isTrue: true,
			info: null
		};
	},
	onLoad(options) {
		this.getDetail(options.id);
	},
	methods: {
		getDetail(code) {
			this.$app.ajax({
				data: {
					param: {
						venueId: uni.getStorageSync('GYMID'),
						code
					}
				},
				api: this.$api.getCode()
			}).then(res => {
				if (res.errorCode != '000000') {
					this.isTrue = false
					this.info = null
				} else {
					this.isTrue = true
					this.info = res.record
				}
			});
		}
	}
};
</script>

<style lang="scss">
.box {
	display: flex;
	align-items: center;
	flex-direction: column;
	margin-top: 120rpx;
}

.box image {
	width: 200rpx;
	height: 220rpx;
}

.box_font {
	font-size: 34rpx;
	font-weight: 600;
	color: #222222;
	margin-top: 20rpx;
}

.box_fontb {
	color: #333333;
	font-size: 28rpx;
	margin-top: 20rpx;
}

.box_ctn {
	width: 690rpx;
	padding: 30rpx 40rpx;
	box-sizing: border-box;
	margin-top: 70rpx;
	color: #333333;
	font-size: 28rpx;
	line-height: 1.5;
	background: #f7f7f7;
	border-radius: 16rpx;
}

.box_ctn .xm {
	font-size: 32rpx;
	font-family: PingFangSC-Medium, PingFang SC;
	font-weight: bolder;
	color: #222222;
}
</style>
